using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace Accountability4net
{
    /// <summary>
    /// The provider configuration
    /// </summary>
    public class ProviderConfig: ConfigurationSection
    {
        /// <summary>
        /// Returns the provider configuration
        /// </summary>
        /// <returns>The configuration</returns>
        public static ProviderConfig GetProviderConfig()
        {
            ProviderConfig config;
            config = (ProviderConfig)ConfigurationManager.GetSection("monengine4net");
            if (config == null)
            {
                config = new ProviderConfig();
                ProviderSettings settings = new ProviderSettings();
                settings.Type = "monengine4net.Provider.MemoryMonengineProvider, monengine4net.MemoryMonengineProvider";
                settings.Name = "MemoryMonengineProvider";
                config.Providers.Add(settings);
            }
            return config;
        }

        /// <summary>
        /// The collection of providers
        /// </summary>
        [ConfigurationProperty("providers")]
        public ProviderSettingsCollection Providers
        {
            get
            {
                return (ProviderSettingsCollection)base["providers"];
            }
        }

    }
}
